;;emacs环境设置
;;整体环境设置
(set-language-environment 'Chinese-GBK)
;;应该和输入有关系
;(set-keyboard-coding-system 'chinese-iso-8bit-with-esc)
;;终端下emacs的中文设置？
;(set-terminal-coding-system 'chinese-iso-8bit-with-esc)
;;文件保存时的编码设置
;(set-buffer-file-coding-system 'chinese-iso-8bit-with-esc)
;;下面两天是emacs和其他程序互相复制／粘贴的设置
;;在帖3（hvj-basicconfig.el）的最后一行中也有相关的一个设定
;(set-selection-coding-system 'chinese-iso-8bit-with-esc)
;(set-clipboard-coding-system 'chinese-iso-8bit-with-esc)
;;什么设置？忘了？有些人没用下面这些
;(modify-coding-system-alist 'process "*" 'chinese-iso-8bit-with-esc)
;(setq default-process-coding-system '(chinese-iso-8bit-with-esc . chinese-iso-8bit-with-esc))
;(setq-default pathname-coding-system 'chinese-iso-8bit-with-esc)


;; (setq w32-charset-info-alist
;;  (cons '("gbk" w32-charset-gb2312 . 936) w32-charset-info-alist))

;;  (setq default-frame-alist
;;  (append
;;  '((font . "fontset-gbk")) default-frame-alist))

;;  (create-fontset-from-fontset-spec
;;  (concat
;; ;;"-outline-Courier New-normal-r-normal-normal-19-97-96-96-c-*-fontset-gbk,"
;;  "-outline-Courier New-normal-r-normal-normal-19-97-96-96-c-*-fontset-gbk,"
;;  ;;这里字体大小19对应于设定的14，而且这个大小必须是奇数
;;  "chinese-gb2312:-outline-Courier New-normal-r-normal-*-14-*-96-96-c-*-iso10646-1,"
;;  "mule-unicode-0100-24ff:-*-Courier New-normal-r-*-*-14-*-96-96-c-*-iso10646-1,"
;;  "chinese-cns11643-5:-*-Courier New-normal-r-normal-*-14-*-96-96-c-*-iso10646-1,"
;;  "chinese-cns11643-6:-*-Courier New-normal-r-normal-*-14-*-96-96-c-*-iso10646-1,"
;;  "chinese-cns11643-7:-*-Courier New-normal-r-normal-*-14-*-96-96-c-*-iso10646-1"))
;;  (set-default-font "fontset-gbk") 



;; (if (not (frame-parameter nil 'font-backend))
;;     (progn
;;       (setq ascii-font 
;;      "-outline-Courier New-normal-r-normal-normal-19-97-96-96-c-*-iso8859-1")
;;       (setq chinese-font
;;      "-outline-宋体-normal-r-normal-normal-16-*-96-96-p-*-iso10646-1")
;;       (defun zw-set-font (en-font cn-font)
;;  (create-fontset-from-fontset-spec
;;   (replace-regexp-in-string "iso8859-1" "fontset-zw" en-font))
;;  (dolist (fnset '("fontset-default" "fontset-zw"))
;;    (set-fontset-font fnset 'gb18030 cn-font)
;;    (set-fontset-font fnset 'iso-8859-15 en-font))
;;  (set-default-font "fontset-zw")
;;  (setq default-frame-alist
;;        (append
;;         '((font . "fontset-zw"))
;;         default-frame-alist)))
;;       (zw-set-font ascii-font chinese-font)))

;; (if (frame-parameter nil 'font-backend)
;;     (progn
;;       (set-default-font "Courier New:pixelsize=16")
;;       (set-fontset-font (frame-parameter nil 'font)
;;    'han '("SimSun" . "unicode-bmp"))
;;       (set-fontset-font (frame-parameter nil 'font)
;;    'symbol '("SimSun" . "unicode-bmp"))
;;       (set-fontset-font (frame-parameter nil 'font)
;;    'cjk-misc '("SimSun" . "unicode-bmp"))
;;       (set-fontset-font (frame-parameter nil 'font)
;;    'bopomofo '("SimSun" . "unicode-bmp"))))



;;字体解码优先顺序
;;从王垠那拷过来的，不用怎么再改吧。
;(setq font-encoding-alist
;(append '(("MuleTibetan-0" (tibetan . 0))
;("GB2312" (chinese-gb2312 . 0))
;("JISX0208" (japanese-jisx0208 . 0))
;("JISX0212" (japanese-jisx0212 . 0))
;("VISCII" (vietnamese-viscii-lower . 0))
;("KSC5601" (korean-ksc5601 . 0))
;("MuleArabic-0" (arabic-digit . 0))
;("MuleArabic-1" (arabic-1-column . 0))
;("MuleArabic-2" (arabic-2-column . 0))) font-encoding-alist))
